package com.ztjava.portal.validator;

import com.jfinal.core.Controller;
import com.ztjava.core.base.BaseValidator;

public class LoginValidator extends BaseValidator{

	@Override
	protected void validate(Controller c) {
		setShortCircuit(true);
		validateRequired("password", "message", "请输入密码！");
		validateRequired("username", "message", "请输入用户名！");
	}

	@Override
	protected void handleError(Controller c) {
		c.setAttr("result", "error");
		c.renderJson(new String[]{"result","message"});;
	}

}
